package com.deyinet.bdcms.core.bean;

/**
 * Created by Administrator on 2017/3/28 0028.
 */
public class AjaxCallBack extends Result {
    private String tabid;
    private String dialogid;
    private String divid;
    private boolean closeCurrent;
    private String forward;
    private String forwardConfirm;
    private String refresh;

    public AjaxCallBack() {
    }

    public static AjaxCallBack addSuccess() {
        AjaxCallBack ajaxCallBack = new AjaxCallBack(200, "添加成功，您还可以继续添加", true);
        return ajaxCallBack;
    }

    public static AjaxCallBack saveSuccess() {
        AjaxCallBack ajaxCallBack = new AjaxCallBack(200, "保存成功", true);
        return ajaxCallBack;
    }

    public static AjaxCallBack deleteSuccess() {
        AjaxCallBack ajaxCallBack = new AjaxCallBack(200, "删除成功", false);
        return ajaxCallBack;
    }

    public static AjaxCallBack handleSuccess() {
        AjaxCallBack ajaxCallBack = new AjaxCallBack(200, "操作成功", true);
        return ajaxCallBack;
    }

    public static AjaxCallBack error(String msg) {
        AjaxCallBack ajaxCallBack = new AjaxCallBack(300, msg, true);
        return ajaxCallBack;
    }

    public static AjaxCallBack timeout() {
        return new AjaxCallBack(301, "未登录", false);
    }

    public AjaxCallBack(int statusCode, String message) {
        this.statusCode = statusCode;
        this.message = message;
    }

    public AjaxCallBack(int statusCode, String message, boolean closeCurrent) {
        this.statusCode = statusCode;
        this.message = message;
        this.closeCurrent = closeCurrent;
    }

    public AjaxCallBack(int statusCode, String message, boolean closeCurrent, String refresh) {
        this.statusCode = statusCode;
        this.message = message;
        this.closeCurrent = closeCurrent;
        this.refresh=refresh;
    }

    public String getTabid() {
        return this.tabid;
    }

    public void setTabid(String tabid) {
        this.tabid = tabid;
    }

    public String getDialogid() {
        return this.dialogid;
    }

    public void setDialogid(String dialogid) {
        this.dialogid = dialogid;
    }

    public String getDivid() {
        return this.divid;
    }

    public void setDivid(String divid) {
        this.divid = divid;
    }

    public boolean isCloseCurrent() {
        return this.closeCurrent;
    }

    public void setCloseCurrent(boolean closeCurrent) {
        this.closeCurrent = closeCurrent;
    }

    public String getForward() {
        return this.forward;
    }

    public void setForward(String forward) {
        this.forward = forward;
    }

    public String getForwardConfirm() {
        return this.forwardConfirm;
    }

    public void setForwardConfirm(String forwardConfirm) {
        this.forwardConfirm = forwardConfirm;
    }

    public String getRefresh() {
        return refresh;
    }

    public void setRefresh(String refresh) {
        this.refresh = refresh;
    }
}
